#pragma once
#include <nice2d/predef.h>
#include <nice2d/widgets/boxlayout.h>
#include <nice2d/widgets/label.h>

class MessageListControlStyle : public LayoutStyle
{
    DECLARE_OBJECT(MessageListControlStyle)
public:
    MessageListControlStyle();
    virtual ~MessageListControlStyle();

    std::shared_ptr<LabelStyle> headerStyle;
    std::shared_ptr<LabelStyle> labelStyle;
    sf::Vector2i itemSize = {240,20};
};

class MessageListControl final: public VBoxLayout
{
    DECLARE_OBJECT(MessageListControl)
    MessageListControl();
public:
    static std::shared_ptr<MessageListControl> create(uint32_t itemcount);
    ~MessageListControl();
public:
    std::shared_ptr<Label> getHeader()const;
    void addMessage(const sf::String& message,const sf::Color& color);
protected:
    void onStyleChanged()override;
private:
    std::unique_ptr<class MessageListControlData> data;
};
